/*
 *  point.h
 *  EPPI-0.0
 *
 *  Created by Juan Carlos Garcia Orden on 15/11/07.
 *
 */

#ifndef _point_h_
#define _point_h_

#include <iostream>
#include <vector>
#include <bitset>
//#include "lmx.h"

using namespace std;

class Point
{
public:
	string name;
	vector<double> r;			/** Vector of coordinates */
//	bool isInComponent;			/** true if it belongs al least to one component */
	/** dofs handled as bitsets */
	bitset<4> dofT;			/** Bitset for additive update dof */
	bitset<4> dofTInertia;	/** 1 means that the dof-T of that position has inertia */
	bitset<3> dofR;			/** Bitset for multiplicative update dof */
	bitset<3> dofRInertia;	/** 1 means that the dof-R of that position has inertia */
	vector<int> globalTNum;	/** Global numbers of translational dofs */
	vector<int> globalRNum;	/** Global numbers of rotational dofs */
	vector<int> globalINum;	/** Global numbers of dofs with inertia*/

public:	
	Point();
	Point(string, vector<double>);
	~Point(){}
	
	vector<double> getCoords(void)	{ return(r); }
	void setDof(int, int);
	void setDofInertia(int, int);
	int setTransNumbers(int);	/** Set global numbers only to translational dofs */
	int setRotNumbers(int);		/** Set global numbers only to rotational dofs */
	int setTRNumbers(int);		/** Set global numbers to both translational and rotational dofs simultaneously */
	int setInertiaNumbers(int, vector<int>&);
	void reportGlobalNumbers();	/** Reports the global dof numbers */
	
	void setDofT(bitset<4> dt)	{ dofT = dt;}
	void setDofR(bitset<3> dr)	{ dofR = dr;}
	int countDofsT()	{ return( dofT.count() ); }
	int countDofsR()	{ return( dofR.count() ); }
	int countDofs()		{ return( dofT.count() + dofR.count() ); }
	vector<int> getGlobalNumbers();
	vector<int> getGlobalInertiaNumbers();
	bitset<4> getDofT()	{return dofT;}
	bitset<3> getDofR()	{return dofR;}
	void updateDofs(vector<double> &, vector<double> &);
};

#endif